課程名稱 |
編譯程式設計 Compiler Design |
開課學期 |
109-1 |
授課對象 |
電機資訊學院 資訊工程學系 |
授課教師 |
徐慰中 |
課號 |
CSIE3230 |
課程識別碼 |
902 39200 |
班次 |
|
學分 |
3.0 |
全/半年 |
半年 |
必/選修 |
選修 |
上課時間 |
星期四7,8,9(14:20~17:20) |
上課地點 |
資107 |
備註 |
總人數上限:30人 |
Ceiba 課程網頁 |
http://ceiba.ntu.edu.tw/1091CSIE3230_Compile |
課程簡介影片 |
|
核心能力關聯 |
核心能力與課程規劃關聯圖 |
課程大綱
|
為確保您我的權利,請尊重智慧財產權及不得非法影印
|
課程概述 |
Overview
Design of a simple compiler
Theory and practice of Scanning
Formal grammars and parsing
Top-down parsing
Bottom-up parsing
Syntax-directed compilation
Declaration processing and Symbol tables
Semantic analysis
Code generation
Program analysis and Optimization
|
課程目標 |
This course is an introduction to compiler design and development. Its focus is on the process and techniques in constructing a compiler, including lexical analysis, parsing, symbol table manipulation, code generation and code optimization. The theory, techniques and algorithms associated with a compiler can be applied to a wide range of problems in software design and development. The goal of this course is to provide students with the essential theory and techniques in building a simple yet complete compiler which generates real ISA (Instruction Set Architecture) code such as the ARMv8. |
課程要求 |
Students are required to implement a real compiler |
預期每週課後學習時數 |
|
Office Hours |
每週四 10:00~12:00 |
指定閱讀 |
待C. N. Fischer, R. K. Cytron, R. J. LeBlanc,
"Crafting a Compiler"
2010
ISBN 10: 0-13-606705-0
ISBN 13: 978-0-13-606705-4
A.V. Aho, M. Lam, R. Sethi, and J.D. Ullman
“Compilers: Principles, Techniques and Tools”
2nd edition, 2007
ISBN 0-321-48681-1補 |
參考書目 |
C. N. Fischer, R. K. Cytron, R. J. LeBlanc,
"Crafting a Compiler"
2010
ISBN 10: 0-13-606705-0
ISBN 13: 978-0-13-606705-4
A.V. Aho, M. Lam, R. Sethi, and J.D. Ullman
“Compilers: Principles, Techniques and Tools”
2nd edition, 2007
ISBN 0-321-48681-1
|
評量方式 (僅供參考) |
|
週次 |
日期 |
單元主題 |
Week 1 |
9/17/2020 |
Introduction |
Week 2 |
9/24/2020 |
1) Introduction
2) Chapter 2 |
Week 3 |
10/01/2020 |
Holiday (Mid-Autumn Festival)
No class |
Week 4 |
10/08/2020 |
Chapter 2: A Simple Compiler |
Week 5 |
10/15/2020 |
Chapter 2: AC-DC Compiler Construction
Chapter 3: Scanner |
Week 6 |
10/22/2020 |
Chapter 3 Scanner
Chapter 1-3 Review Quiz
|
Week 7 |
10/29/2020 |
Chapter 4: CFG and Parser
Chapter 5: Top Down Parsing
|
Week 8 |
11/05/2020 |
Chapter 6: Bottom-Up (Shift-Reduce) Parsing
|
Week 9 |
11/12/2020 |
Chapter 7: Syntax Directed Translation and Parser Generator YACC/Bison
Chapter 4-7 Review Quiz
Take Home Exam (11/13 evening to 11/15 11:00pm) |
Week 10 |
11/19/2020 |
Chapter 8: Declaration Processing and Symbol Table
|
Week 11 |
11/26/2020 |
Chapter 8: Type expressions and type equivalence
Chapter 9: Semantic Analysis
|
Week 12 |
12/03/2020 |
Code Generation for RISC-V |
Week 13 |
12/10/2020 |
Code Generation for Assignments and Expressions.
Simple Register Allocation
Register Convension
|
Week 14 |
12/17/2020 |
Code Generation for Control Structures |
Week 15 |
12/24/2020 |
Code Generation for Arrays and Procedure Calls
|
Week 16 |
12/31/2020 |
1) Compiler Optimizations: Principles and Basic algorithms
2) Transformations and Analyses
|
Week 17 |
1/07/2021 |
Register Allocation and Code Scheduling |
Week 18 |
1/14/2020 |
Final Exam (Take Home: Post on 1/15 6pm, due 1/17 11pm)) |
|